package com.un.ebs.inventory.domain;

import java.util.Date;

import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.*;

import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import org.springframework.stereotype.Component;
import lombok.Data;
import com.un.ebs.core.metadata.DbField;

/**
 * 仓库(Warehouse)表实体类
 *
 * @author liubo
 * @since 2020-07-22 08:21:00
 */
@Data
@Component
@TableName("tb_warehouse")
@SuppressWarnings("serial")
public class Warehouse extends Model<Warehouse> {

    @TableId(value = "id", type = IdType.UUID)
    private String id;


    @DbField(name = "parent_id", comment = "父级仓库ID", length = 40, precision = 0)
    private String parentId;

    @DbField(name = "code", comment = "仓库代码", length = 10, precision = 0)
    private String code;

    @DbField(name = "name", comment = "仓库名称", length = 100, precision = 0)
    private String name;

    @DbField(name = "address", comment = "地址", length = 100, precision = 0)
    private String address;

    @DbField(name = "tel", comment = "电话", length = 20, precision = 0)
    private String tel;

    @DbField(name = "remark", comment = "备注", length = 100, precision = 0)
    private String remark;

    @DbField(name = "is_receive", comment = "是否收货货位", length = -1, precision = 0)
    private Boolean isReceive;

    @DbField(name = "is_deliver", comment = "是否发货货位", length = -1, precision = 0)
    private Boolean isDeliver;

    @DbField(name = "is_store", comment = "是否存储货位", length = -1, precision = 0)
    private Boolean isStore;

    @DbField(name = "is_producer", comment = "是否生产货位", length = -1, precision = 0)
    private Boolean isProducer;

    @DbField(name = "is_temp", comment = "是否临时货位", length = -1, precision = 0)
    private Boolean isTemp;

    @DbField(name = "is_bad", comment = "是否不良品货位", length = -1, precision = 0)
    private Boolean isBad;

    @TableLogic
    @DbField(name = "is_delete", comment = "是否删除", length = -1, precision = 0)
    private Boolean isDelete;

    @TableField(fill = FieldFill.INSERT)
    @DbField(name = "create_time", comment = "创建时间", length = -1, precision = 0)
    private Date createTime;

    @TableField(fill = FieldFill.INSERT)
    @DbField(name = "create_at", comment = "创建人", length = 40, precision = 0)
    private String createAt;

    @TableField(fill = FieldFill.INSERT)
    @DbField(name = "create_at_name", comment = "创建人", length = 100, precision = 0)
    private String createAtName;

    @DbField(name = "tenant_id", length = 40, precision = 0)
    private String tenantId;

    @DbField(name = "is_material", length = -1, precision = 0)
    private Boolean isMaterial;

    @DbField(name = "is_product", length = -1, precision = 0)
    private Boolean isProduct;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}